<%--
  Created by IntelliJ IDEA.
  User: Albert Lee
  Date: 2020/5/8
  Time: 16:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>application实现计数统计</title>
</head>
<body>
<h4>对象实现网页计数器</h4>application
<br />获取用户名：<%=application.getAttribute("name") %>
<br />本网站当前访问次数为：
<%
    int mycount = Integer.valueOf(application.getAttribute("count").toString()).intValue();
    out.print(mycount);
    application.setAttribute("count",Integer.toString(mycount+1));
%>
<br />
<a href="ApplicationA.jsp">返回</a>
</body>
